<template>
	<view class="cent">
			<view style="height: 92px;width: 355px; background:rgba(255,255,255,1);border-radius:8px;margin-top: 10px;">
				<view style="display: flex;align-items: center;height: 35px;margin-top: 5px;">
					<text style="color: #FE0700;margin: 0  5px  0  20px;">*</text>
					<text style="color: #000000;">银行名称</text>
				</view>
				<input type="text" placeholder="请输入银行名称" style="height: 50px;margin-left: 34px;" v-model="bankname" />
			</view>
		<view style="height: 92px;width: 355px; background:rgba(255,255,255,1);border-radius:8px;margin-top: 10px;">
				<view style="display: flex;align-items: center;height: 35px;margin-top: 5px;">
					<text style="color: #FE0700;margin: 0  5px  0  20px;">*</text>
					<text style="color: #000000;">持卡人姓名</text>
				</view>
				<input type="text" placeholder="请输入持卡人姓名" style="height: 50px;margin-left: 34px;" v-model="bankusername" />
			</view>
			<view style="height: 92px;width: 355px; background:rgba(255,255,255,1);border-radius:8px;margin-top: 10px;">
					<view style="display: flex;align-items: center;height: 35px;margin-top: 5px;">
						<text style="color: #FE0700;margin: 0  5px  0  20px;">*</text>
						<text style="color: #000000;">银行卡号</text>
					</view>
					<input type="text" placeholder="请输入银行卡号" style="height: 50px;margin-left: 34px;" v-model="bankid" />
				</view>
		<button @click="newcaotas">保存</button>
	</view>
</template>

<script>
	import {ajaxs} from "../../captainapi.js"
export default {
	data() {
		return {
			name: '',
			phone: ''
		};
	},
	methods: {
		newcaotas() {
			uni.showLoading({
				title: '添加中请稍等'
			});
			ajaxs({
				url: '/v1/user/bankCard/add',
				method: 'post',
				data: {
					bankName: this.bankname,
					bankAccount: this.bankid,
					usePeopleName:this.bankusername,
					accountType:1,
					 debitType:1,
					 status:0,
				},
				success(res) {
					if (res.data.status == 'OK') {
						uni.hideLoading();
						uni.navigateBack({
							delta: 1
						});
					} else {
						uni.showToast({
							title: res.data.message, // 标题
							icon: 'none'
						});
					}
				}
			});
		}
	}
};
</script>

<style>
	page{
		height: 100%;
	}

button {
	width: 355px;
	height: 44px;
	background: rgba(4, 42, 88, 1);
	border-radius: 8px;
	color: #ffffff;
	position: fixed;
	bottom: 20px;
}
</style>
